import Vue from "vue";
import App from "./App.vue";
import router from "./router";
import store from "./store";
// 导入api接口
import api from './api'
// 按需引入 vant
import {
  Swipe, SwipeItem, Lazyload, Button, ActionSheet, Field, Uploader,
  Checkbox, Radio, RadioGroup, Icon, Toast, Dialog, Popup, Picker, Overlay,
  Calendar, Tab, Tabs
} from "vant";
// 重置 vant 样式
import "../src/assets/css/resetui.less";
import VConsole from 'vconsole'

// 动态title
import VueWechatTitle from 'vue-wechat-title'
Vue.use(VueWechatTitle)

if (process.env.NODE_ENV === 'production') {
  new VConsole()
}

Vue.prototype.$api = api; // 将api挂载到vue的原型上

Vue.use(Swipe)
  .use(SwipeItem)
  .use(Lazyload).use(Button).use(ActionSheet).use(Field).use(Uploader)
  .use(Checkbox).use(Radio).use(RadioGroup).use(Icon).use(Toast).use(Dialog)
  .use(Popup).use(Picker).use(Overlay).use(Calendar).use(Tab).use(Tabs)


// 将所有 loading Toast 设置为背景不可点击 (2.2.10 版本开始支持)
Toast.setDefaultOptions('loading', { forbidClick: true });

Vue.config.productionTip = false;

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount("#app");
